import { BasicColumn, FormSchema } from '/@/components/Table';

export const columns: BasicColumn[] = [
  {
    title: '租户ID',
    dataIndex: 'tenantId',
  },
  {
    title: '商品名称',
    dataIndex: 'name',
  },
  {
    title: '商品类型ID',
    dataIndex: 'categoryId',
  },
  {
    title: '商品品牌ID',
    dataIndex: 'brandId',
  },
  {
    title: '原价【起】',
    dataIndex: 'originPrice',
  },
  {
    title: '现价【起】',
    dataIndex: 'price',
  },
  {
    title: '销量',
    dataIndex: 'sales',
  },
  {
    title: '商品主图',
    dataIndex: 'picUrl',
  },
  {
    title: '商品图册',
    dataIndex: 'album',
  },
  {
    title: '单位',
    dataIndex: 'unit',
  },
  {
    title: '商品简介',
    dataIndex: 'description',
  },
  {
    title: '商品详情',
    dataIndex: 'detail',
  },
  {
    title: '商品状态：0-下架 1-上架',
    dataIndex: 'status',
  },
];

export const searchFormSchema: FormSchema[] = [
  {
    field: 'tenantId',
    label: '租户ID',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'name',
    label: '商品名称',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'categoryId',
    label: '商品类型ID',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'brandId',
    label: '商品品牌ID',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'originPrice',
    label: '原价【起】',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'price',
    label: '现价【起】',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'sales',
    label: '销量',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'picUrl',
    label: '商品主图',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'album',
    label: '商品图册',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'unit',
    label: '单位',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'description',
    label: '商品简介',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'detail',
    label: '商品详情',
    component: 'Input',
    colProps: { span: 6 },
  },
  {
    field: 'status',
    label: '商品状态：0-下架 1-上架',
    component: 'Input',
    colProps: { span: 6 },
  },
];

export const formSchema: FormSchema[] = [
  {
    field: 'id',
    label: 'ID',
    component: 'Input',
    show: false,
  },
  {
    field: 'tenantId',
    label: '租户ID',
    component: 'Input',
    required: true,
  },
  {
    field: 'name',
    label: '商品名称',
    component: 'Input',
    required: true,
  },
  {
    field: 'categoryId',
    label: '商品类型ID',
    component: 'Input',
    required: true,
  },
  {
    field: 'brandId',
    label: '商品品牌ID',
    component: 'Input',
    required: true,
  },
  {
    field: 'originPrice',
    label: '原价【起】',
    component: 'Input',
    required: true,
  },
  {
    field: 'price',
    label: '现价【起】',
    component: 'Input',
    required: true,
  },
  {
    field: 'sales',
    label: '销量',
    component: 'Input',
    required: true,
  },
  {
    field: 'picUrl',
    label: '商品主图',
    component: 'Input',
    required: true,
  },
  {
    field: 'album',
    label: '商品图册',
    component: 'Input',
    required: true,
  },
  {
    field: 'unit',
    label: '单位',
    component: 'Input',
    required: true,
  },
  {
    field: 'description',
    label: '商品简介',
    component: 'Input',
    required: true,
  },
  {
    field: 'detail',
    label: '商品详情',
    component: 'Input',
    required: true,
  },
  {
    field: 'status',
    label: '商品状态：0-下架 1-上架',
    component: 'Input',
    required: true,
  },
];
